
<div class="container-fluid" style="width: 400px;">
    <form id="createForm" method="post" class="form-horizontal modal-form">
        <input id="id" name="id" th:type="hidden" />
        <div class="form-group">
            <label for="name" class="control-label">角色名</label>
            <input id="name" name="name" type="text" class="form-control" />
        </div>
        <div class="form-group">
            <label for="title" class="control-label">标题</label>
            <input id="title" name="title" type="text" class="form-control" />
        </div>
        <div class="form-group">
            <label for="description" class="control-label">描述</label>
            <textarea id="description" name="description" type="" class="form-control"/>
        </div>

        <br />
        <button type="button" class="btn btn-primary btn-block" onclick="doCreate()">保 存</button>

    </form>

    <script type="text/javascript" th:src="@{/js/modalPage.js}"></script>

    <script>
        function doCreate(){
            $.ajax({
                type: 'post',
                url: '/role/create',
                data: $('#createForm').serialize(),
                success: function(result) {
                    if (result.status != 0) {
                        failHandler(result);
                    } else {
                        successConfirm();
                        closeModal();
                    }
                },
                error: errorHandler
            });
        }
    </script>

</div>

